﻿using DAL.Register;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    /// <summary>
    /// 借还记录类
    /// </summary>
    public class BookBorrowReturnDAL
    {
        /// <summary>
        /// 获取全部借还记录
        /// </summary>
        /// <returns></returns>
        public DataTable ReaderShowDAL()
        {
            string sql = $@"SELECT b.ID 编号,a.ReaderID 读者编号,a.BorrowTime 借书时间,a.ReturnTime 还快时间,b.Name 图书名称,
                            c.ReadName 读者名称,c.Mobile 读者手机号,c.Address 读者地址
                            FROM BookBorrowReturnInfo as a
                            INNER JOIN BookInfo b
                            ON a.BookID= b.ID
                            LEFT OUTER JOIN ReaderInfo c
                            ON c.ReaderID=a.ReaderID";
            return SQLHelper.Query(sql, null);
        }
    }
}
